import 'package:flutter/material.dart';

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {

    //标题栏
    Widget titleContainer = new Container(
      padding: const EdgeInsets.all(30.0),
      child: new Row(
        children: <Widget>[
          new Expanded(child: new Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              new Container(
                padding: const EdgeInsets.only(bottom: 8.0),
                child: new Text(
                  "我是标题",
                  style: new TextStyle(
                    fontWeight: FontWeight.bold
                  )
                ),
              ),
              new Text(
                "我是副标题",
                style: new TextStyle(
                  color: Colors.grey[500]
                ),
              )
            ],
          )),
          new Icon(
            Icons.star,
            color: Colors.red[500],
          ),
          new Text("41")
        ],
      ),
    );

    Column _buildButtonColumn(IconData icon,String label) {
      Color color = Theme.of(context).primaryColor;

      return new Column(
        mainAxisSize: MainAxisSize.min,
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          new Icon(
              icon,
              color: color,
          ),
          new Container(
            margin: const EdgeInsets.only(top: 8.0),
            child: new Text(
              label,
              style: new TextStyle(
                fontSize: 12.0,
                fontWeight: FontWeight.w400,
                color: color
              ),
            ),
          )
        ],
      );
    }

    Widget buttonContainer = new Container(
      child: new Row(
        mainAxisAlignment: MainAxisAlignment.spaceEvenly,
        children: <Widget>[
          _buildButtonColumn(Icons.call, "打电话"),
          _buildButtonColumn(Icons.near_me, "短信"),
          _buildButtonColumn(Icons.share, "分享"),
        ],
      ),
    );

    Widget textContainer = new Container(
      padding: const EdgeInsets.all(32.0),
      child: new Text(
        "''''爱上啦啦啦氨基酸的那颗近十年的氨基酸卡仕达卡上理解的卡视角的拉时间段卢卡斯的拉卡时间段拉卡时间段拉卡时间段拉卡时间段拉斯科技的拉卡涉及到了 拉斯科技的",
        softWrap: true,
      ),
    );

    return new Scaffold(
      body: new ListView(
        children: <Widget>[
          new Image.asset(
            "images/timg.jpg",
            height: 240.0,
            fit: BoxFit.cover,
          ),
          titleContainer,
          buttonContainer,
          textContainer
        ],
      ),
    );
  }
}